博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
小程序animation动画效果综合应用案例(交流QQ群:604788754)
阅读量:7086 次
发布时间:2019-06-28

本文共 1714 字,大约阅读时间需要 5 分钟。

如果案例有问题,可到QQ群找到今日相关压缩文件下载测试。

WXML:

电话
发布
咨询

WXSS:

.cebian {  width: 50px;  height: auto;  display: flex;  flex-direction: column;  position: fixed;  bottom: 60px;  right: 20px;  z-index: 10;  overflow: hidden;}.anniu{  position: relative;  left: 50px;}.cebian01, .cebian02,.cebian03,.cebian04 {  height: 50px;  width: 50px;  text-align: center;  line-height: 50px;  border-radius: 60px;  color: #fff;}.cebian02,.cebian03,.cebian04{  margin-top: 10px;}.cebian01{  background-color: #50cb67;}.cebian02{  background-color: #6785e5;}.cebian03{  background-color: #ec4149;}.cebian04{  background-color: #949494;  position: relative;}.cebian04>image{  width: 30px;  height: 30px;  position: relative;  top: 10px;  }

JS:

Page({  data: {    jiantous: false,    anniuimg: '/picture/jiantou01.png',  },  /*右侧按钮部分效果*/  onReady: function () {    this.animation = wx.createAnimation();    this.animations = wx.createAnimation()  },  anniuhide: function () {    var leftjian = this.data.jiantous;    if (leftjian == false) {      this.animation.translate(50, 0).step();      this.animations.rotate(180).translate(3,0).step();      leftjian = true;    } else {      this.animation.translate(0, 0).step();      this.animations.rotate(0).translate(0, 0).step();      leftjian = false;    }    this.setData({      animation: this.animation.export(),      animations: this.animations.export(),      jiantous: leftjian,    });  },})

效果图:

转载于:https://www.cnblogs.com/yiweiyihang/p/7119540.html

你可能感兴趣的文章
部分科技股已经“富可敌国”,这是一场泡沫吗
查看>>
中国方案入选世界5G标准
查看>>
光伏补贴降温
查看>>
新“幽灵主机”技术加强僵尸网络生存能力
查看>>
光伏“第三矩阵”企业为何不理想?
查看>>
英特尔公司CEO科再奇:数据是未来无人驾驶的新“石油”
查看>>
Qualcomm与TDK宣布联手成立合资公司
查看>>
Mirai新攻击 导致非洲一国全断网
查看>>
一个需求价值评估的方法——靶图
查看>>
Loadrunner11无法启动IE的解决办法
查看>>
强大的PyTorch:10分钟让你了解深度学习领域新流行的框架
查看>>
钉钉争议的冷思考:犀利表象下暗藏平等理念
查看>>
美国互联网公司欲修复与特朗普关系 呼吁支持加密
查看>>
mybatis中动态sql常用的标签
查看>>
“大数据风控”方兴未艾,最终需要的还是硬技术
查看>>
互联汽车面临的网络安全问题
查看>>
菜鸟也能飞:SQL数据库实战专业教程(三)
查看>>
Android启动过程深入解析
查看>>
五个维度相互关联全面分析智能硬件与物联网行业
查看>>
帮助首席执行官了解大数据项目的三大技巧
查看>>